#include "Vector3.h"


template <typename T>
Vector3<T>::Vector3<T>()
{
}

template <typename T>
Vector3<T>::Vector3<T>(T x, T y,T z)
{
	this->x = x;
	this->y = y;
	this->z = z;
}

template <typename T>
Vector3<T>::~Vector3<T>()
{
}

/*
template <typename T>
Vector3<T>& Vector3<T>::operator=(const Vector3 &other)
{
	if (this == &other)      // Same object?
		return *this;
	x = other.x;
	y = other.y;
	z = other.z;
	return *this;
}
*/

template <typename T>
Vector3<T>& Vector3<T>::operator+=(const Vector3 &other)
{
	x += other.x;
	y += other.y;
	z += other.z;
	return *this;
}

template <typename T>
Vector3<T>& Vector3<T>::operator-=(const Vector3 &other)
{
	x -= other.x;
	y -= other.y;
	z -= other.z;
	return *this;
}

template <typename T>
Vector3<T>& Vector3<T>::operator/=(const Vector3 &other)
{
	x /= other.x;
	y /= other.y;
	z /= other.z;
	return *this;
}

template <typename T>
Vector3<T>& Vector3<T>::operator*=(const Vector3 &other)
{
	x *= other.x;
	y *= other.y;
	z *= other.z;
	return *this;
}

template <typename T>
Vector3<T>& Vector3<T>::operator+(const Vector3 &other)
{
	return Vector3(*this) += other;
}

template <typename T>
Vector3<T>& Vector3<T>::operator-(const Vector3 &other)
{
	return Vector3(*this) -= other;
}

template <typename T>
Vector3<T>& Vector3<T>::operator*(const Vector3 &other)
{
	return Vector3(*this) *= other;
}

template <typename T>
Vector3<T>& Vector3<T>::operator/(const Vector3 &other)
{
	return Vector3(*this) /= other;
}

template <typename T>
Vector3<T>& Vector3<T>::operator+=(const T &other)
{
	x += other;
	y += other;
	z += other;
	return *this;
}

template <typename T>
Vector3<T>& Vector3<T>::operator-=(const T &other)
{
	x -= other;
	y -= other;
	z -= other;
	return *this;
}

template <typename T>
Vector3<T>& Vector3<T>::operator/=(const T &other)
{
	x /= other;
	y /= other;
	z /= other;
	return *this;
}

template <typename T>
Vector3<T>& Vector3<T>::operator*=(const T &other)
{
	x *= other;
	y *= other;
	z *= other;
	return *this;
}

template <typename T>
Vector3<T>& Vector3<T>::operator+(const T &other)
{
	return Vector3(*this) += other;
}

template <typename T>
Vector3<T>& Vector3<T>::operator-(const T &other)
{
	return Vector3(*this) -= other;
}

template <typename T>
Vector3<T>& Vector3<T>::operator*(const T &other)
{
	return Vector3(*this) *= other;
}

template <typename T>
Vector3<T>& Vector3<T>::operator/(const T &other)
{
	return Vector3(*this) /= other;
}

template <typename T>
bool Vector3<T>::operator==(const Vector3 &other)
{
	if(x != other.x) return false;
	if(y != other.y) return false;
	if(z != other.z) return false;
	return true;
}

template <typename T>
bool Vector3<T>::operator!=(const Vector3 &other)
{
	return !(*this == other);
}

template <typename T>
std::string Vector3<T>::print()
{
	std::stringstream oss;
	oss << "[" << x  << "," << y << "," << z << "]";
	return 
}

